import { UseActionControlReturnType } from '@/hooks/useActionControl';
import { Button } from 'antd';

interface ActionControlAddButtonProps {
  actionControl: UseActionControlReturnType;
  initData?: any;
}

const ActionControlAddButton = ({
  actionControl,
  initData = {},
}: ActionControlAddButtonProps) => {
  return (
    <Button
      loading={actionControl.loading.value}
      type="primary"
      onClick={() => actionControl.actions.openAddModal({ ...initData })}
    >
      新增
    </Button>
  );
};

export default ActionControlAddButton;
